package ar.org.sstuyv


import geb.Browser


class LoginTest {
	
	void testSomething() {
		loginUser()
	  }
	  
	  def loginUser(){
		  Browser.drive {
			  go "http://localhost:8080/SIG/login/auth"
	  
			  assert title == "Login"
			  
			  $("input", name: "j_username").value("pepe")
			  $("input", name: "j_password").value("grillo")
	  
			  $("input", id: "submit").click()
			  
			  assert title == "Login"
	  
			  $("input", name: "j_username").value("morolucas")
			  $("input", name: "j_password").value("morolucas")
	  
			  $("input", id: "submit").click()
			  
			  assert title == "Welcome to Grails"
			  
		  }
	  }
}
